for i in range(1,10):
    for ii in range(1,i+1):
        print('{} * {} = {:>2}'.format(ii,i,i*ii),end='   ')
    print()

print('-----------' * 10)

for i in range(9,0,-1):
    for ii in range(1,i+1):
        print('{} * {} = {:>2}'.format(ii,i,i*ii),end='   ')
    print()

print('-----------' * 11)

for i in range(1,10):
    print(' ' * 13 * (9 - i), end='   ')
    for ii in range(1,i+1):
        print('{} * {} = {:>2}'.format(ii,i,i*ii),end='   ')
    print()

print('-----------' * 11)
for i in range(9,0,-1):
    print(' ' * 13 * (9 - i), end='   ')
    for ii in range((10-i),10):
        print('{} * {} = {:>2}'.format((10-i),ii,ii*(10-i)),end='   ')
    print()